package com.buss.accounting.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

/**
 * 收款明细
 * @author gykl
 *
 */
@Entity
@Table(name = "acc_receiptdetail")
@TableGenerator(name="receiptDetail_pk_sequence",initialValue=1,allocationSize=1,pkColumnName="seq_col",
	pkColumnValue="recdetail_seq",valueColumnName="seq_val",table="accounting_pk_sequence")
public class ReceiptDetail implements Serializable {

	private static final long serialVersionUID = 7179327898591060369L;
	
	/**表主键*/
	@Id
	@GeneratedValue(strategy=GenerationType.TABLE,generator="receiptDetail_pk_sequence")
	private Long id;

	/**收款单ID*/
	@Column(nullable=false)
	private Long masterId;
	
	/**收款单据号*/
	@Column(nullable=false,length=20)
	private String billNumber;
	
	/**收款单据来源*/
	@Column(nullable=false)
	@Enumerated(value=EnumType.STRING)
	private ReceiptBillSource billSource;
	
	/**收款金额*/
	@Column(nullable=false,scale=2)
	private Float amount;
	
	/**备注*/
	@Column(length=254)
	private String intro;
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getMasterId() {
		return masterId;
	}

	public void setMasterId(Long masterId) {
		this.masterId = masterId;
	}

	public String getBillNumber() {
		return billNumber;
	}

	public void setBillNumber(String billNumber) {
		this.billNumber = billNumber;
	}

	public ReceiptBillSource getBillSource() {
		return billSource;
	}

	public void setBillSource(ReceiptBillSource billSource) {
		this.billSource = billSource;
	}

	public Float getAmount() {
		return amount;
	}

	public void setAmount(Float amount) {
		this.amount = amount;
	}

	public String getIntro() {
		return intro;
	}

	public void setIntro(String intro) {
		this.intro = intro;
	}

	/**收款单据来源*/
	public enum ReceiptBillSource{
		sell("销售收款"),
		purreturn("采购退款");
		
		private String value;
		public String getValue(){
			return value;
		}
		ReceiptBillSource(String value){
			this.value = value;
		}
	}
}
